function [seq, IC] = generateLFSR_Seuence(  )
%GENERATELFSR_SEUENCE Summary of this function goes here
%   Detailed explanation goes here

%% Initialize
IC=zeros(6,8);

%% Generate the sequence
%% SEQ 1 (8,7,6,1)
% reg=zeros(1,8);
reg_tmp=zeros(1,8);
reg=randsrc(1,8,[0 1]);
IC(1,:) = reg;
% reg_tmp=randsrc(1,8);
reg(1)=1;
seq=zeros(6,256);
for i=1:255
    seq(1,i)=reg(1);
    reg_tmp(8)=reg(1);
    reg_tmp(7)=xor(reg(1), reg(8));
    reg_tmp(6)=xor(reg(1), reg(7));
    reg_tmp(5)=reg(6);
    reg_tmp(4)=reg(5);
    reg_tmp(3)=reg(4);
    reg_tmp(2)=reg(3);
    reg_tmp(1)=xor(reg(1), reg(2));
    for j=1:8
        reg(j)=reg_tmp(j);
    end
end
%% SEQ 2 (8,7,5,3)
reg=randsrc(1,8,[0 1]);
IC(2,:) = reg;
reg_tmp=zeros(1,8);
reg(1)=1;
for i=1:255
    seq(2,i)=reg(1);
    reg_tmp(8)=reg(1);
    reg_tmp(7)=xor(reg(1), reg(8));
    reg_tmp(6)=reg(7);
    reg_tmp(5)=xor(reg(1), reg(6));
    reg_tmp(4)=reg(5);
    reg_tmp(3)=xor(reg(1), reg(4));
    reg_tmp(2)=reg(3);
    reg_tmp(1)=reg(2);
    for j=1:8
        reg(j)=reg_tmp(j);
    end
end

%% SEQ 3 (8,7,3,2)
reg=randsrc(1,8,[0 1]);
IC(3,:) = reg;
reg_tmp=zeros(1,8);
reg(1)=1;
for i=1:255
    seq(3,i)=reg(1);
    reg_tmp(8)=reg(1);
    reg_tmp(7)=xor(reg(1), reg(8));
    reg_tmp(6)=reg(7);
    reg_tmp(5)=reg(6);
    reg_tmp(4)=reg(5);
    reg_tmp(3)=xor(reg(1), reg(4));
    reg_tmp(2)=xor(reg(1), reg(3));
    reg_tmp(1)=reg(2);
    for j=1:8
        reg(j)=reg_tmp(j);
    end
end

%% SEQ 4 (8,6,5,4)
reg=randsrc(1,8,[0 1]);
IC(4,:) = reg;
reg_tmp=zeros(1,8);
reg(1)=1;
for i=1:255
    seq(4,i)=reg(1);
    reg_tmp(8)=reg(1);
    reg_tmp(7)=reg(8);
    reg_tmp(6)=xor(reg(1), reg(7));
    reg_tmp(5)=xor(reg(1), reg(6));
    reg_tmp(4)=xor(reg(1), reg(5));
    reg_tmp(3)=reg(4);
    reg_tmp(2)=reg(3);
    reg_tmp(1)=reg(2);
    for j=1:8
        reg(j)=reg_tmp(j);
    end
end

%% SEQ 5 (8,6,5,3)
reg=randsrc(1,8,[0 1]);
IC(5,:) = reg;
reg_tmp=zeros(1,8);
reg(1)=1;
for i=1:255
    seq(5,i)=reg(1);
    reg_tmp(8)=reg(1);
    reg_tmp(7)=reg(8);
    reg_tmp(6)=xor(reg(1), reg(7));
    reg_tmp(5)=xor(reg(1), reg(6));
    reg_tmp(4)=reg(5);
    reg_tmp(3)=xor(reg(1), reg(4));
    reg_tmp(2)=reg(3);
    reg_tmp(1)=reg(2);
    for j=1:8
        reg(j)=reg_tmp(j);
    end
end


%% SEQ 6 (8,6,5,2)
reg=randsrc(1,8,[0 1]);
IC(6,:) = reg;
reg_tmp=zeros(1,8);
reg(1)=1;
for i=1:255
    seq(6,i)=reg(1);
    reg_tmp(8)=reg(1);
    reg_tmp(7)=reg(8);
    reg_tmp(6)=xor(reg(1), reg(7));
    reg_tmp(5)=xor(reg(1), reg(6));
    reg_tmp(4)=reg(5);
    reg_tmp(3)=reg(4);
    reg_tmp(2)=xor(reg(1), reg(3));
    reg_tmp(1)=reg(2);
    for j=1:8
        reg(j)=reg_tmp(j);
    end
end
%%

end

